home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5016 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  905 b 

  1. Path: news.bridge.net!news
  2. From: David Byrden <100101.2547@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Help! Allocating 3 dimensional or greater arrays in C++
  5. Date: 2 Feb 1996 04:26:18 GMT
  6. Organization: self-employed
  7. Message-ID: <4es3pa$g4m@news.bridge.net>
  8. References: <310CD09F.1D71@ns.vvm.com>
  9. NNTP-Posting-Host: ppp-mia3-103.bridge.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  14.  
  15.  
  16. >>        int *matrix;
  17. >>        int **pmatrix = &matrix;
  18. >>        int ***ppmatrix = &pmatrix;
  19. >>        int size;
  20. >>        matrix = new int[10];
  21. >>        pmatrix = new matrix[10];
  22. >>        ppmatrix = new pmatrix[10];
  23.  
  24. This all goes sadly wrong at  "new matrix[10]"
  25.  
  26. The "new" keyword requires a type name, but "matrix" is a variable's name.
  27.  
  28. Why not try    new int[10][10][10]
  29.  
  30.  
  31.                        David
  32.  
  33.  
  34.  
  35.